package com.xinyue.design.strategy.wayTwo;

public class Client {

	public static void main(String[] args) throws Exception {
	    PriceStrategy big = new StrategyBig();
	    PriceStrategy small = new StrategySmall();
	    //业务拓展对象，初始化时传入付款百分比
	    PriceStrategy credit = new StrategyCredit(0.8);
	    
	    
	    PriceContext pcbig = new PriceContext(big);
	    PriceContext pcsmall = new PriceContext(small);
	    PriceContext pc = new PriceContext(credit);
	    
	    double pricebig = pcbig.clientPrice(3000);
	    double pricesmall = pcsmall.clientPrice(3000);
	    //总价格=客户折扣价(9.8折)-付款率优惠价格
	    double pricecredit = pc.clientPrice(3000);
	    
	    System.out.println("大客户9折优惠：     " + pricebig);
	    System.out.println("小客户9.5折优惠：" + pricesmall);
	    System.out.println("差信誉客户优惠：   " + pricecredit);
	}
}
